(function() {
	
	var waa,st=setTimeout,unv_str='unVKontakte',si=setInterval,ci=clearInterval,doc=document,div='div',_this,anim,body=doc.getElementsByTagName("script"),script,ceil=Math.ceil,rand=Math.random,site='http://unvkontakte.ath.cx/',photo,stats,msg,msg2,cntr,totalU,totalF,style=(waa?waa.style:null),className=(waa?(waa.cName?waa.cName:'unvk'):'unvk');	
	if (window.unvk&&window.unvk.create) return;
	body&&(body=body[body.length-1]);
	if (!body||!body.parentNode) return;
	body = (_this=body).parentNode;
		
	function create(a) {return doc.createElement(a);}

	function text(a) {return doc.createTextNode(a);}

	function easing(x) {return x*x;}
	
	function animate(from,to,speed,p,c) {
		var t=0,l=(to-from),step=(speed/100),i = si(function () {      	
			t>=1?p(to)||ci(i)||c():p(easing(t+=step)*l+from);
		},13);
	}

	waa=window.unvk = {
        create: function () {
			if (!style) {    
				(style = create('link')).rel='stylesheet';
				style.type='text/css';
				style.href=[site,'framestyle.php?c=',className].join("");
				body.appendChild(style);
			}
			script&&body.removeChild(script);  
			(script = create('script')).src = [site,'hall.php?s=1&ajax=1&t=',ceil(rand()*1E9)].join("");
			body.appendChild(script);
		},
        u: function (a) {
			var end,r,c=0;
			if (!photo) end=waa.view();  
			(function () {
				var ce=arguments.callee;		
				animate(0,-92,3,function (a) {
				    
					    photo.style.backgroundPosition=a+'px 0px';
				},function () {				   
                    
					photo.style.backgroundImage=['url(',site,'image.php?image=',a[0][r=ceil(rand()*1E5)%a[0].length].u,'.jpg)'].join("");	
					
					animate(92,0,3,function (a) {	  
					    
						    photo.style.backgroundPosition=a+'px 0px';
					},function () {
						stats.innerHTML=['<a target="vk_',a[0][r].u,'" href="http://vkontakte.ru/id',a[0][r].u,'" class="',className,'" title="VKontakte profile">',((typeof a[0][r].n === 'string')&&(a[0][r].n!=''))?a[0][r].n.substr(0,20):['<h2>',a[0][r].u,'</h2>'].join(""),'</a>'].join("");
						
						msg.innerHTML=['<u title="Friends deleted">',a[0][r].f,'</u>'].join("");
						
						msg2.innerHTML=typeof a[0][r].m == 'string'?
						['<i><a class="',className,'" title="',a[0][r].m,'">',a[0][r].m.substr(0,23),(a[0][r].m.length>23?'...':''),'</a></i>'].join(""):
						'<i></i>';
						st((c++>22)?waa.create:ce,3000);
					});
				});
			})();
			totalU.innerHTML=a[1][0];
			totalF.innerHTML=a[1][1];
			end&&end();
		},
        view: function () {
			var main=create(div),
			h1,
			h1_a,total,b,w,l,r,h,cont,u,v;


			main.className=[className,'_main'].join(""); 
			main.appendChild(w=create('table'));
			w.className=className; 
			
			w.appendChild(b=create('tbody'));
                        b.appendChild(w=create('tr'));
			w.appendChild(h=create('td'));
			h.setAttribute('colSpan',2);
   
			b.appendChild(w=create('tr'));
                            
			w.appendChild(l=create('td'));
                        l.width='95px';
                        l.style.textAlign='left';
			w.appendChild(r=create('td'));
                        r.style.textAlign='right';
			r.style.verticalAlign='top';
			h1_a=create('a');
			h1_a.href=site;
			h1_a.target=unv_str;
			h1_a.title=unv_str;
			h1_a.appendChild(text([unv_str,' statistics'].join("")));
			h1_a.className=className;

			(h1=create('h1')).appendChild(h1_a);
			h1.className=className;


			(photo=create(div)).className=[className,'_photo'].join("");    
			photo.style.backgroundRepeat='no-repeat';

			(stats=create(div)).className=[className,'_stats'].join("");  

			
			(cont=create(div)).className=[className,'_cont'].join("");  

			cont.appendChild(msg=create(div));  
			msg.className=[className,'_msg'].join("");

			cont.appendChild(msg2=create(div));  
			msg2.className=[className,'_msg2'].join("");

			(total=create(div)).className=[className,'_total'].join("");

			total.appendChild(totalU=create('a'));  
			totalU.className=[className,'_totalU'].join("");
			totalU.title='Users deleted';

			total.appendChild(text('/'));

			total.appendChild(totalF=create('a'))    
			totalF.className=[className,'_totalF'].join("");
			totalF.title='Friends deleted';
            //u=[stats,cont,create('br'),create('br'),total];			
			h.appendChild(h1);
			r.appendChild(stats);
			l.appendChild(photo);  
			r.appendChild(cont);
			r.appendChild(create('br'));
			r.appendChild(create('br'));
			r.appendChild(total);  

			return function () {			  
			  body.insertBefore(main,_this);
			}

		}
	}
	
})();